package com.demo.component;

import com.demo.model.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author vivi
 * @description
 * @date 2024/5/21
 */
@Component
public class StudentBeans {
    @Bean
    public Student student1() {
        Student student = new Student();
        student.setName("sehun");
        student.setAge(31);
        student.setId(1);
        return student;
    }
    @Bean
    public Student student2() {
        Student student = new Student();
        student.setName("ViVi");
        student.setAge(20);
        student.setId(0);
        return student;
    }

}





















